package com.qf.api.recharge.feign;

import com.qf.api.config.FeignConfig;
import com.qf.api.recharge.fallback.RechargeFallbackFactory;
import com.qf.common.core.common.R;
import com.qf.common.core.dto.BalanceChangeDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author GaoQiangLiang
 */
@FeignClient(name = "osm-user",
        //url = "http://10.8.165.123:8100", // 这行仅用于测试
        //url = "http://10.8.165.131:8100",
        configuration = FeignConfig.class,
        fallbackFactory = RechargeFallbackFactory.class)
public interface RechargeFeignService {
    @PostMapping("/user/remote/balance")
    R changeBalance(@RequestBody BalanceChangeDTO balanceChangeDTO);

    @GetMapping("/user/avatars")
    List<String> getAvatarsByUserIds(@RequestParam("ids") List<Integer> ids);
}
